lockable section management questions

Hi,

I have a couple questions on lockable section managememt:

1) Is there a way I can know if a lockable section has unsaved data. There is a unsaved (Module) function that gives me this information for the entire module. I would like a similar function but that only reports the unsaved status of a given Lockable section, more precisely the lockable section containing the current object.

2) Is there a way I can loop through all objects within a given lockable section, the same way I can for the entire module (ex: for Object in entire Module do). I like the "entire" keywork because it loops through eveything independently of the display set or show Deletion status. I would like to do the same think for a givne lockable section.

3) Is there a way I could relate an object to a given Lockable section, other then by navigating back the parent list until I hit an object which does not inherit from its parent? Something like a hidden attribute or a lockable section object list?

Patrice
phenri - Thu Oct 13 18:46:55 EDT 2011

Re: lockable section management questions
llandale - Fri Oct 14 11:46:41 EDT 2011

I'll answer out of sequence.
<2> You can navigate to parents until you find the root object of that section. Then you can recursively use the "for oChild in o do" loop, which sequences through each direct child of that object. Will need to experiment whether that loop finds objects that are filtered out.
<1> You could loop through all the objects in the section <2> above and query if each one is either "new(oChild)" or "unsaved(oChild)".

<3> Are you asking how to find out which section object is the parent of this object? Only way I know is to search up until you find a specific access object.

It was a pretty big mistake years ago for QSS to relate "lockable sections" with "inherited rights", but now they are reluctant to change that.
 

  • Louie

These may get you going.

bool   IsUnSavedSection(Object obj)
{      // Is this object or any of its children unsaved?
       // ** RECURSIVE ENABLED **
   if (null obj) return(false)
   if (new(obj) or unsaved(obj)) return(true)
   Object oChild
   for oChild in obj do
   {  if (IsUnSavedSection(oChild)) return(true)   // ** RECURSION **
   }
   return(false)
}  // end IsUnSavedSection()
 
Object GetParentSection(Object obj)
{    // If this object is in a shared section, return its parent
       // ** RECURSIVE ENABLED **
    if (null obj)   return(null Object)
 
    bool IsInherited = false
    isAccessInherited(obj, IsInherited)
    if (!IsInherited)     return(obj)    // This object is the section head
    return(GetParentSection(parent(obj)) // ** RECURSION **
}
 
oSection = GetParentSection(current Object)
if (null oSection) //
then warningBox("not in a section")
elseif(IsUnSavedSection(current Object)) //
then infoBox("Section is UnSaved")
else infoBox("Section has no changes")

Re: lockable section management questions
phenri - Sat Oct 15 12:58:47 EDT 2011

llandale - Fri Oct 14 11:46:41 EDT 2011

I'll answer out of sequence.
<2> You can navigate to parents until you find the root object of that section. Then you can recursively use the "for oChild in o do" loop, which sequences through each direct child of that object. Will need to experiment whether that loop finds objects that are filtered out.
<1> You could loop through all the objects in the section <2> above and query if each one is either "new(oChild)" or "unsaved(oChild)".

<3> Are you asking how to find out which section object is the parent of this object? Only way I know is to search up until you find a specific access object.

It was a pretty big mistake years ago for QSS to relate "lockable sections" with "inherited rights", but now they are reluctant to change that.
 

  • Louie

These may get you going.

bool   IsUnSavedSection(Object obj)
{      // Is this object or any of its children unsaved?
       // ** RECURSIVE ENABLED **
   if (null obj) return(false)
   if (new(obj) or unsaved(obj)) return(true)
   Object oChild
   for oChild in obj do
   {  if (IsUnSavedSection(oChild)) return(true)   // ** RECURSION **
   }
   return(false)
}  // end IsUnSavedSection()
 
Object GetParentSection(Object obj)
{    // If this object is in a shared section, return its parent
       // ** RECURSIVE ENABLED **
    if (null obj)   return(null Object)
 
    bool IsInherited = false
    isAccessInherited(obj, IsInherited)
    if (!IsInherited)     return(obj)    // This object is the section head
    return(GetParentSection(parent(obj)) // ** RECURSION **
}
 
oSection = GetParentSection(current Object)
if (null oSection) //
then warningBox("not in a section")
elseif(IsUnSavedSection(current Object)) //
then infoBox("Section is UnSaved")
else infoBox("Section has no changes")

That helps a lot thank you.

Now there are 2 possible changes to a section that won't be detected by your exemple. New deleted objects, and new undeleted objects. How would you detect those?

Also, even though new(o) and unsaved(o) is working, I searched the DOORS 9.1 DXL reference guide and there are no mention of these. Only unsaved(m) is mentioned.

Is there is comlete list of function returning Object status? Is there a lot of these undocumented dxl funtions?

Re: lockable section management questions
llandale - Sun Oct 16 17:42:53 EDT 2011

phenri - Sat Oct 15 12:58:47 EDT 2011
That helps a lot thank you.

Now there are 2 possible changes to a section that won't be detected by your exemple. New deleted objects, and new undeleted objects. How would you detect those?

Also, even though new(o) and unsaved(o) is working, I searched the DOORS 9.1 DXL reference guide and there are no mention of these. Only unsaved(m) is mentioned.

Is there is comlete list of function returning Object status? Is there a lot of these undocumented dxl funtions?

Oops, I hate it when that happens. Went through all this earlier this year and thought I'd covered all the bases. You are right, unsaved(o) fails to detect softDelete and unDelete; and I notice the change bars don't see it also. Running out of time today but I wonder about the status when the object has been moved or cut-pasted, indicating the section must be saved. And I wonder about scenarios where you moved an object under another one, to the children that are now level n+1 qualify as being "changed", and do their sections need to be "saved"?

A few of us folks have edited the doors.exe file, stripped away all garbage, and left a syntax list of every command. So yes we can see the name of every command, the types of all its input and output parameters, and the type of returned variable; and of course all the overloaded versions. Someone out there has some program to strip it all out nice and clean and when I see that I'll use that list. My program method deletes all the non-ascii codes and tries to do reasonable formatting based on regular expressions and is about 85% successful, but the other 15% are a bear, and even the formatted parts need extra tabs to line things up so I can read it.

Its real handy so long as you have some idea what you are looking for, such as all commands dealing with variable type "ModName_"; or know the name of the function.

  • Louie

Re: lockable section management questions
phenri - Tue Oct 18 19:48:44 EDT 2011

llandale - Sun Oct 16 17:42:53 EDT 2011
Oops, I hate it when that happens. Went through all this earlier this year and thought I'd covered all the bases. You are right, unsaved(o) fails to detect softDelete and unDelete; and I notice the change bars don't see it also. Running out of time today but I wonder about the status when the object has been moved or cut-pasted, indicating the section must be saved. And I wonder about scenarios where you moved an object under another one, to the children that are now level n+1 qualify as being "changed", and do their sections need to be "saved"?

A few of us folks have edited the doors.exe file, stripped away all garbage, and left a syntax list of every command. So yes we can see the name of every command, the types of all its input and output parameters, and the type of returned variable; and of course all the overloaded versions. Someone out there has some program to strip it all out nice and clean and when I see that I'll use that list. My program method deletes all the non-ascii codes and tries to do reasonable formatting based on regular expressions and is about 85% successful, but the other 15% are a bear, and even the formatted parts need extra tabs to line things up so I can read it.

Its real handy so long as you have some idea what you are looking for, such as all commands dealing with variable type "ModName_"; or know the name of the function.

  • Louie

Today I found by luck the function I was looking for in Section 13 Object of the DOORS 9.0 dxl reference guide:

Declaration
bool sectionNeedsSaved(Object o)
Operation
Returns true if o is contained within an object hierarchy that has been modified but not saved. Otherwise, returns false.

It does exactly what I wanted to and handle all the corner cases we were tlaking about.
(:

Re: lockable section management questions
llandale - Wed Oct 19 15:44:47 EDT 2011

phenri - Tue Oct 18 19:48:44 EDT 2011
Today I found by luck the function I was looking for in Section 13 Object of the DOORS 9.0 dxl reference guide:

Declaration
bool sectionNeedsSaved(Object o)
Operation
Returns true if o is contained within an object hierarchy that has been modified but not saved. Otherwise, returns false.

It does exactly what I wanted to and handle all the corner cases we were tlaking about.
(:

It doesn't say if THIS object needs to be saved, just whether its in a lockable section that needs saved. I think it returns false in Edit mode, but we should check that.

Seems to me years ago that this function, and sibling "unsaved(mod)" failed to detect certain changes and we were closing modules after changes that ended up not getting saved.

  • Louie

Re: lockable section management questions
SystemAdmin - Wed Oct 19 20:42:00 EDT 2011

llandale - Wed Oct 19 15:44:47 EDT 2011
It doesn't say if THIS object needs to be saved, just whether its in a lockable section that needs saved. I think it returns false in Edit mode, but we should check that.

Seems to me years ago that this function, and sibling "unsaved(mod)" failed to detect certain changes and we were closing modules after changes that ended up not getting saved.

  • Louie

Since you are discussing lockable sections ----

I used to do this when a certain module was in its own module. Now it is a lockable section in a big master module and it takes too long.
 

copy(module(currentModule), newModuleName, thisModuleDesc);
move(item (newModuleName), folder (dataFolder));
// next do things like remove sections, columns etc.


Is there a way to do something similar to a lockable section?

 

 

copy(ActiveLockableSection(currentModule), newModuleName, thisModuleDesc);
move(item (newModuleName), folder (dataFolder));
// next do things like remove sections, columns etc.



The ActiveLockableSection() is a made up feature I'm hoping exists. Is there anything like it?

With the technique above, you keep the same object IDs, views, outlinks, and structure



 

 

Re: lockable section management questions
Mathias Mamsch - Thu Oct 20 08:24:03 EDT 2011

SystemAdmin - Wed Oct 19 20:42:00 EDT 2011

Since you are discussing lockable sections ----

I used to do this when a certain module was in its own module. Now it is a lockable section in a big master module and it takes too long.
 

copy(module(currentModule), newModuleName, thisModuleDesc);
move(item (newModuleName), folder (dataFolder));
// next do things like remove sections, columns etc.


Is there a way to do something similar to a lockable section?

 

 

copy(ActiveLockableSection(currentModule), newModuleName, thisModuleDesc);
move(item (newModuleName), folder (dataFolder));
// next do things like remove sections, columns etc.



The ActiveLockableSection() is a made up feature I'm hoping exists. Is there anything like it?

With the technique above, you keep the same object IDs, views, outlinks, and structure



 

 

No there is not anything like it. Why would someone regularly copy the currently locked part of a module to a new module? How shall that even be accomplished? You can lock a single object/section in a module and then you want to copy that object to a new module keeping its ID without any context (parent objects)? I would be really interested in the use case there. Is this about 'change management' where people checkout parts of a module and later want to check in the module? Why not copy the whole module (and maybe later delete the part that is not of interest)? Module to large?

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: lockable section management questions
SystemAdmin - Thu Oct 20 11:13:55 EDT 2011

Mathias Mamsch - Thu Oct 20 08:24:03 EDT 2011
No there is not anything like it. Why would someone regularly copy the currently locked part of a module to a new module? How shall that even be accomplished? You can lock a single object/section in a module and then you want to copy that object to a new module keeping its ID without any context (parent objects)? I would be really interested in the use case there. Is this about 'change management' where people checkout parts of a module and later want to check in the module? Why not copy the whole module (and maybe later delete the part that is not of interest)? Module to large?

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Thanks for your response Mathias.

I looked around myself yesterday and the only DXL function usable is copy (as in the whole module).


copy(module)


Declaration

bool copy(ModName_ modRef, string newName, string newDesc) { ... }

 

Operation

Copies module modRef to new name newName, with description newDesc, within the same folder or project. All outgoing links are copied, but incoming links are not copied, and linksets are not updated.

 

 



The use case is test procedures. The requirements, design, and interface control modules are linked.

The copied out part NEVER goes back in the master.

Each test procedure used to be in its own module. The test procedure covers all variations for its scope. When we do an actual test run the general test procedure is chiseled down to the desired test purpose by filtering by customer, hardware parameters, etc.

The test data will go in the test run but the test data never goes back in the master. The tailored test instance is moved to a test runs folder and hangs out for a while and is eventually archived.

This is necessary because both the test procedure text and the outbound links to requirements can change over time.

The process is:

 

 

  • Make a copy of the master test procedure module.
  • Note the baseline version (as linked requirements may change over time).
  • Delete all the sections except the one of interest.
  • Pare down the test procedure of interest by:
    • Applying filters
    • Deleting the objects not shown
  • Take test data with the custom tailored test procedure (with all N/A sections deleted)
  • Keep for evidence, reporting, trend analysis.


The alternative is:

 

 

  • create a new module
  • copy custom types
  • copy views
  • copy the master's object IDs and put them in a new column for correlation with the master module
  • recreate the structure of interest
  • copy the attribute content


The copy whole module and pare-down approach is very reliable and seldom requires maintenance. You never have to worry about missing types or views and the DOORS object numbers are preserved.

I was just looking for some tricks to speed it up. I was hoping there might be something like ...

 

 

 

bool copy(ModName_ modRef, string newName, string newDesc) { ... }



... that would instead of "copy whole module" would instead do "copy specified lockable section"

Since there is not, I'll stick to copying the whole module and deleting the N/A sections.



 

 

Re: lockable section management questions
llandale - Thu Oct 20 13:51:15 EDT 2011

SystemAdmin - Wed Oct 19 20:42:00 EDT 2011

Since you are discussing lockable sections ----

I used to do this when a certain module was in its own module. Now it is a lockable section in a big master module and it takes too long.
 

copy(module(currentModule), newModuleName, thisModuleDesc);
move(item (newModuleName), folder (dataFolder));
// next do things like remove sections, columns etc.


Is there a way to do something similar to a lockable section?

 

 

copy(ActiveLockableSection(currentModule), newModuleName, thisModuleDesc);
move(item (newModuleName), folder (dataFolder));
// next do things like remove sections, columns etc.



The ActiveLockableSection() is a made up feature I'm hoping exists. Is there anything like it?

With the technique above, you keep the same object IDs, views, outlinks, and structure



 

 

You could copy the whole module, then search the new module deleting and purging all objects that are not currently Locked in the original module, except of course for those object's ancestors.